#
#  OSPFv2 config test suite Makefile
#

#----------------------------------------------------------- SETUP

VERSION = 0.2.1
TOPDIR = ../../../../../../..
include $(TOPDIR)/Makefile.common

JAVAC = javac -classpath $(SSFNET_TEST_CLASSPATH)
JAVA  = java  -classpath $(SSFNET_TEST_CLASSPATH)

# This is for the cygwin environment which has trouble with the mix of
# slashes and backslashes... Take care, that the classpath is set correctly!
ifeq ($(OSTYPE), cygwin)
JAVAC = javac
JAVA  = java
endif

SHARED=../shared
VERDICT=$(SHARED)/verdict.pl
REPORT=report.log
COMPLETE=complete.log

#TESTS=01_area_param 02_if_param 03_rtrlsa_bits 04_ip_header\
#05_virtual_stub 06_auth_1583 07_auth_2328 \
#08_checksum 09_num_adv 10_packet_len 11_lsaheader_len\
#12_num_links 13_num_tos 14_bad_lsa_age

TESTS=01_area_param 02_if_param 09_num_adv\
10_packet_len 11_lsaheader_len 12_num_links 14_bad_lsa_age

#----------------------------------------------------------- MAKE tests
tests:
	@list='$(TESTS)'; for testcase in $$list; do \
	(cd $$testcase && $(MAKE))\
	done;
	@$(VERDICT) config.ospf.v4.ip $(REPORT) $(TESTS) > $(REPORT)
	@cat $(REPORT)

#----------------------------------------------------------- MAKE report
report:
	@echo "######## Complete Test Report for config.ospf.v4.ip ########" > $(COMPLETE)
	@list='$(TESTS)'; for testcase in $$list; do \
	(cat $$testcase/report.log >> $(COMPLETE))\
	done;
	@cat $(REPORT) >> $(COMPLETE)
	
#----------------------------------------------------------- MAKE clean
clean:
	rm -f *.log *.tcpdump *.dump *.bak
	@list='$(TESTS)'; for testcase in $$list; do \
	(cd $$testcase && $(MAKE) clean)\
	done;
